package random.fox.p2p.model;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import random.fox.p2p.AppModule;
import random.fox.p2p.interactors.RegisterInteractor;
import random.fox.p2p.presenter.RegisterPresenter;
import random.fox.p2p.presenter.RegisterPresenterImpl;
import random.fox.p2p.ui.RegisterView;
import random.fox.p2p.ui.SetPasswordView;
import random.fox.p2p.view.IRegisterView;

/**
 * Created by wq on 15/3/19.
 */
@Module(
        injects = {
                RegisterView.class,
                SetPasswordView.class
        },
        addsTo = AppModule.class
)
public class RegisterModule {
    private IRegisterView registerView;
    public RegisterModule(IRegisterView iRegisterView){
        this.registerView = iRegisterView;
    }

    @Singleton @Provides IRegisterView provideIRegisterView(){
        return registerView;
    }

    @Singleton @Provides RegisterPresenter provideRegisterPresenter(IRegisterView registerView,RegisterInteractor interactor){
        return new RegisterPresenterImpl(registerView,interactor);
    }

}
